-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(input) add md-dense and match css to spec #8209
Conversation
Because of the way labels work now, this fixes #7403 on IE Appears to improve upon (probably minor coincidence) #8167 Tested on IE10 and fixes #7881 Fixes 1px issue with #7772 (removed) No pixel shift on invalid input, fixing #7175 Fixes md-autocomplete height #7153 New height calculation fixes #6800 New message handling fixes #6767 Fixes centering checkboxes without text #3793 |
@clshortfuse - Really EXCELLENT work here. @devversion and I really like the clickable cross-hair to compare alignments. |
@ThomasBurleson Thanks! You can probably tell this took a bit of work. This is really my first time playing with SCSS. From a maintainability standpoint, maybe somebody could suggest a better I also didn't know how to support md-dense being anywhere in the parent. Right now, you'd have to add Some things that might cause issues are
You may see strange pixel numbers (for example |
Just tested on Firefox. It needs
IE10,11,Edge work fine. Go figure. |
squashed, rebased and tested on Firefox, IE10, IE11, Safari and Chrome I also added RTL and Ellipsis examples. No regressions spotted. |
@clshortfuse Just FYI: It is really difficult to test and review a PR, which contains so many sub-fixes. Separated PR's are more appropriated in my opinion.
How does that fix #7477? |
@devversion You're right. It doesn't. That's my mistake. I know it's a huge batch of changes, but changing one thing normally breaks another. There are a few things I can separate. I could separate 3 ways
|
07e0443
to
bbf6c64
Compare
rebased again, I also added blank checkbox checks to the codepen. Checkboxes should now center properly in a table. |
@clshortfuse - I am excited to review this next week. Thanks for your efforts with this. |
@crisbeto - can you review and test ? |
Sure, but it won't be until tomorrow at least. @clshortfuse can you rebase meanwhile? |
Rebased. it took me a bit because I had to readjust for I did find a bug with http://codepen.io/shortfuse/pen/aZOvVg Everything else is on the two original codepens. On another note, node-sass fails on node v6.20 even with |
|
Ah it's not accounting for the scrolling position. I'll file a separate issue for it. Shouldn't stop this from going through, though. |
@crisbeto - one major concern with this PR... does it affect any public CSS that we currently have?
|
@include rtl(padding-right, $input-container-padding, 0); | ||
@include rtl(padding-left, 0, $input-container-padding); | ||
//@include rtl(text-align, right, left); | ||
//@include rtl(padding-right, $input-container-padding, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to stay commented?
e10a5d0
to
f5d5f4a
Compare
c428de8
to
c87bff5
Compare
fix textarea fix textarea padding on focus use md-input-has-label and md-input-has-messages fix spec test add password spacing fix bottom margin hide md-error-spacer when blank and messages present correct md-select and md-checkbox add doc for md-no-border md-select-menu font-size matches md-select font-size fix textarea [rows] support fix hints demo fix autocomplete fix select with label fix text-less checkbox width textarea: use padding only if height isn't 0 remove redundant css release: version revert textarea back to default box-sizing align md-icon to top of input box (support all font-sizes) correct icon top when label present add md-dense fix dense font-size add md-dense for select fix messages and error spacing for md-dense md-dense for typed inputs corrected margin/padding remove box-sizing fix autocomplete dense correct padding-right on textarea with label add force label horizontal position (fixes firefox) fix focused textarea padding size fix formatting rename back to -border-width-default add support for resizable textareas make md-resize-handle dynamically positioned add md-spacing values remove horizontal padding on last-child, md-block, or layout-column add docs for md-spacing change .md-resize-handle float to support rtl (just in case) remove unneeded CSS combine classes in input.js remove bad semicolon revert input demo force new positioning revert new lines renamed variables smarter horizontal end margin layout changes fix .md-inline-form fix md-select sizing on IE10-11 fix md-select sizing on IE10-11 revert default top to 50% rework md-datepicker to new format fix(checkbox) rework checkbox to match Material Design spec automatic 16px horizontal padding when in row configuration change checkbox size from 20px to 18px blank checkboxes are sized properly add md-spacing options for different spacing styles add alignment math support custom margins for md-checkbox fix alignment fix alignment more alignment fixes rebase fix new offset parameters
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support - Add and remove `md-input-has-label` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height 1:1 with font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space bottom border per spec - Use dynamic upper margins dependent on label existance - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will not resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Prune unneeded CSS - Correct horizontal offsets per spec - Support dynamic lower margins dependent on message existance - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support - Add and remove `md-input-has-label` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height 1:1 with font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space bottom border per spec - Use dynamic upper margins dependent on label existance - Support dynamic lower margins dependent on message existance - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will not resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Revert back to padding-top instead of margin-top and find alterate method for increasing click target - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support - Add and remove `md-input-has-label` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height 1:1 with font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space bottom border per spec - Use dynamic upper margins dependent on label existance - Support dynamic lower margins dependent on message existance - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will not resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Revert back to padding-top instead of margin-top and find alterate method for increasing click target - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: `order` is only used in flex layouts) - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Clean up karma issues with textarea being shifted to box-sizing - Fix md-icon alignment issues - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS ( - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: `order` is only used in flex layouts) - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: `order` is only used in flex layouts) - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
Rebase in #9344 |
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: `order` is only used in flex layouts) - Add md-dense support This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: `order` is only used in flex layouts) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Create workaround for helper text or just build support for it - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
** WIP DO NOT MERGE ** md-input always had extra margins for placement of labels and messages without every reducing or removing them if said elements were not present. Label components were not properly changing based on font-size, but instead, used a scaling system that had poor dynamic font-size support and introduced pixel aliasing on certain browsers. - Add and remove `md-input-has-label` class dynamically - Add and remove `md-input-has-messages` class dynamically - Position label with the proper distance from the top per spec - Transition label position and font-size depending on focus state per spec - Use `will-change` CSS to alert browser of animation change for smoothness - Set input height relative to font-size with a minimum of 16px per spec - Revert `box-sizing` to default to properly space underline per spec - Use dynamic upper margins dependent on label existance - Use dynamic lower margins dependent on message existance - Correct animation timings for smoother font-size transition - Remove unneeded CSS (ie: leftover rules from when input used flex) - Add md-dense support - Revert need for wrapping resize handler - Use CSS for message animation, fixing JS issues with ngIf This commit allows more flexibility with labels and input boxes. Input elements can now support any font-size. Labels will now resize dynamically, correcting issues related to text with width longer than space available. Various costly CSS rules have also been removed. Performance should also be better due to use of `will-change` and initialization with `transform3d`. TODO: - Increasing click target for touch interaction - Prune unneeded CSS - Correct horizontal offsets per spec - Correct md-select positioning - Correct md-autocomplete positioning - Correct md-datepicker positioning Rebase of angular#8209 Fixes: (TODO)
I've rewritten many of the scss and js files to conform to Material Design spec. There are many changes, but it wasn't possible to separate much of these into smaller pull requests because of the way they depend on each other. I have changes for md-toolbar that can be used later on another PR.
Here are codepens I've made to show the issues with the current implementations and the new changes. Be sure to set your browser with to less than 960px for toolbar height to match the examples.
Layout Tests
Master: http://codepen.io/shortfuse/full/ZWxYpN/
SpecFix: http://codepen.io/shortfuse/full/qZojGW/
Horizontal Tests
Master: http://codepen.io/shortfuse/full/JKGdQv/
SpecFix: http://codepen.io/shortfuse/full/gMPYjE/
In summary, over JS, input-containers will have the classes
md-input-has-label
andmd-input-has-messages
so certain CSS rules can apply dependent on if there is a label and/or messages.md-input
,md-autocomplete
, andmd-select
md-no-border
option for md-selectmd-select-menu
font-size
matchesmd-select
font-size
md-autocomplete
spacingmd-checkbox
widthmd-icon
to top of input box (support all font-sizes)md-input
26 / 30
instead of26/30
)Material Design Sources:
https://www.google.com/design/spec/components/text-fields.html
https://www.google.com/design/spec/patterns/errors.html